package com.songwp.controller;

import com.songwp.entity.CategoryTreeNode;
import com.songwp.service.AreaTreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Project:
 * @Description:
 * @Auther: songwp
 * @Date: 2022/2/26 18:10
 **/
@RestController
public class AreaTreeController {

    @Autowired
    AreaTreeService areaTreeService;

    @GetMapping("/getTreeList")
    public List<CategoryTreeNode> getTreeList(){
        return areaTreeService.getSymptomTreeJson();
    }

    @GetMapping("/getByName")
    public CategoryTreeNode getByName(@RequestParam("name") String name){
        return areaTreeService.selectByName(name);
    }
}
